06. Protect Menu Pages

Protect Menu Pages

Question:

Start Quiz:

Solution:

INSTRUCTOR NOTE:

Click to view the publicmenu.html and publicrestaurants.html templates.

Note:

In order to view the profile picture of the creator of each menu, add code to your project.py file to query the creator:

creator = getUserInfo(restaurant.user_id)

then pass in the creator object when you render the template:

return render_template('publicmenu.html', items = items, restaurant = restaurant, creator= creator)

Inside your templates you can now use {{creator.picture}} and {{creator.name}} to share the name and picture of each restaurant creator.